import express from 'express';

import request from '../../util/request.js'

var router = express.Router();
// 小程序登录
export default function(jscode) {
  
  const params = {
    js_code: jscode,
    appid: process.env.MINIAPPID, 
    secret: process.env.MINISECRET,
    grant_type: 'authorization_code'
  }
  return request({
    url: 'https://api.weixin.qq.com/sns/jscode2session',
    method: 'get',
    params
  })
}
